L2-L6 - Path Testing I (Structural)

SOFTWARE QUALITY ASSURANCE (SQA)
- function of software quality that assures that standards, processes, and procedures are apropriate and correctly implemented. 
- measure quality of design
- measure quality of conformance

TESTING VS SQA
- testing --> product-oriented
- SQA --> process-oriented
- improve process = better product

TESTING CYCLE
1) Reqs. Analysis
	- testing begins
2) Design Analysis
	- testers + developers work together
	- determine what aspects of design destable
3) Testing Plan	
	- test strategy, test plan
4) Test Development
	- test procedures, test scenarios, test cases, test scripts
5) Test Execution
6) Test Reporting
7) Retesting Defects

PATH TESTING PROCESS
- Input
	- source code
	- test selection strategy
- Process
	- generate CFG
	- select paths
	- generate test input data
	- feasibility test of path
	- evaluation of output for selected test case

TEST COVERAGE CRITERIA
- specific things that must be covered during testing (statements, paths, etc.)
- Node Coverage --> execute every statement
- Edge Coverage --> execute every branch
- Path Coverage --> execture chosen paths
- Loops --> looping structures
- Data Flow Coverage --> augment CFG
	- defs. = statements that assign values to variables
	- uses = statements that use variables

WHITE-BOX PATH TESTING STRATEGIES
- McCabe Basis (lineraly independent) Path Testing
	- every independent path executed at least once
	- Minimum Number of Test Cases (MNTC) = e - n + 2
	- Test Effectiveness Ratio (TER) = (# linearly independent paths covered) / (total # of linearly independent paths)
- Statement Testing
	- execute every statement at least once
	- find set of paths such that every node lies on at leat one path
- Loop Testing
	- skip loop entirely
	- only one pass through loop
- Simple Path Testing
	- every simple path executed at least once
	- simple path --> does not contain the same edge more than once
- Branch Testing
	- every branch is executed at least once
	- find set of paths such that every edge lies on at least one path
- All Path Testing
	- every path is executed at least once
	- find all DD-paths through graph
- Advantages
	- rigorous definition
	- mathematical analysis
	- precise measurements
- Disadvantages
	- infeasible paths
	- cannot guarantee adequate soft. testing 
	- hard to make test cases

Infeasible Paths
- test paths that cannot be satisfied

TESTING EFFECTIVENESS VS. EFFICIENCY
- Effectiveness
	- cover as many defects as possible
- Efficiency
	- find largest number of defects possibly with fewest resources

DATA FLOW TESTING
- Goal --> systematic way to examin points at which faults may occur

- def: location where variable defined
- use: locatoin where variable used

- DEF(v,n) --> v is defined at statement n
	-I-def (defined by input)
	-A-def (defined by assignment)

- USE(V,m) --> v is used at statement n
	- P-use --> predicate statement
		- outdegree >= 2
	- C-use --> computation use
		- outdegree <= 1
		- O-use (output) ex. screen print
		- L-use (location) ex. position of array
		- I-use (iteration) ex. for loops

- DU-Path (definition use) --> m & n are initial and final nodes in path respectively
- DC-Path (definition clear) --> m & n are initial and final nodes, v is not defined anywhere else

- All-Defs --> all v contain defintion clear paths from def to use
- All-Uses --> all v contain defintion clear paths from def to use, and successor node of each use
- All-DU-Paths --> same as above + cycle-free

1) Draw data flow graph
2) Select data-flow testing criteria (select strategy)
3) Identify flow graph to satisfy selection criteria (select paths)
4) Produce test cases  